Back to course home
0% completed
Vote For New Content
Merge K Sorted Lists (hard)
Problem Statement
Given an array of âKâ sorted LinkedLists, merge them into one sorted list.
Example 1:
Input: L1=[2, 6, 8], L2=[3, 6, 7], L3=[1, 3, 4]
Output: [1, 2, 3, 3, 4, 6, 6, 7, 8]
Example 2:
Input: L1=[5, 8, 9], L2=[1, 7]
Output: [1, 5, 7, 8, 9]
Constraints:
k == lists.length- 0 <= k <= 104
0 <= lists[i].length <= 500- -104 <= lists[i][j] <= 104
lists[i]is sorted in ascending order.- The sum of
lists[i].lengthwill not exceed 104.
Try it yourself
Try solving this question here:
Java
. . . .
Solution: First Missing Positive
Solution: Merge K Sorted Lists
Mark as Completed
On this page
Problem Statement
Try it yourself